package com.camunda.workflow.config.mybatis;

import com.mybatisflex.core.FlexGlobalConfig;
import com.mybatisflex.core.keygen.KeyGeneratorFactory;
import com.mybatisflex.spring.boot.MyBatisFlexCustomizer;
import org.springframework.context.annotation.Configuration;

import static com.camunda.workflow.common.consts.CommonCst.KEY_GEN;

/**
 * MyBatisFlexCustomizer 是 MyBatis-Flex 为了方便 SpringBoot 用户对 MyBatis-Flex 进行初始化而产生的接口。
 */
@Configuration
public class MyBatisFlexConfig implements MyBatisFlexCustomizer {
    @Override
    public void customize(FlexGlobalConfig config) {
        KeyGeneratorFactory.register(KEY_GEN, new KeyGen());
    }
}
